/**
 * 
 */
package happywing.server.planing;

import java.util.Date;
import java.util.List;

import happywing.server.FunctionalSystem;
import happywing.server.exceptions.InvalidTimeException;

/**
 * @author Administrator
 *
 */
public class PlanningSystem extends FunctionalSystem {
	/**
     * 私有的(private)唯一(static final)实例成员,在类加载的时候就创建好了单例对象
     */
    private static final PlanningSystem instance = new PlanningSystem();
    /**
     * 私有构造方法,避免外部创建实例
     */
    private PlanningSystem() {
    }
    
    /**
     * 静态工厂方法,返回此类的唯一实例.
     * @return PlanningSystem
     */
    public static PlanningSystem getInstance() {
        return instance;
    }
    
    public void addPlan(IPlan plan,IPlan parentPlan,Integer priority,List<IPlan> depends) throws InvalidTimeException { 
    	if (parentPlan.getStartDate().after(plan.getStartDate())||plan.getEndDate().after(parentPlan.getEndDate())) {
			throw new InvalidTimeException();
		}
    	//plan.setParentPlan(parentPlan,priority);
	}
    
    public void name() {
		
	}
    
    
}
